package com.dw.config;

import com.dw.web.dto.Response;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author zhangjing
 * @date 2020/8/21 15:53
 * @Description 全局异常处理器
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    /**
     * 捕捉的Shiro异常
     * @param
     * @return
     */
    @ExceptionHandler(AuthorizationException.class)
    public Response authorizationExceptionHandler(AuthorizationException e) {
        return Response.unAuthorized();
    }

}
